package com.lmiot.xyclick.Bean.SQL;

import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import com.uuzuche.lib_zxing.decoding.Intents;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import org.greenrobot.greendao.internal.DaoConfig;

public class AutoBeanDao extends AbstractDao<AutoBean, Long> {
    public static final String TABLENAME = "AUTO_BEAN";

    public static class Properties {
        public static final Property AutoID = new Property(1, String.class, "autoID", false, "AUTO_ID");
        public static final Property AutoName = new Property(3, String.class, "autoName", false, "AUTO_NAME");
        public static final Property AutoType = new Property(2, String.class, "autoType", false, "AUTO_TYPE");
        public static final Property AutoTypeDetail = new Property(5, String.class, "autoTypeDetail", false, "AUTO_TYPE_DETAIL");
        public static final Property Color = new Property(13, String.class, "color", false, "COLOR");
        public static final Property CreateTime = new Property(7, String.class, "createTime", false, "CREATE_TIME");
        public static final Property GroupID = new Property(8, String.class, "groupID", false, "GROUP_ID");
        public static final Property Icon = new Property(12, String.class, "icon", false, "ICON");
        public static final Property Id = new Property(0, Long.class, "id", true, "_id");
        public static final Property IsEnable = new Property(6, Boolean.TYPE, "isEnable", false, "IS_ENABLE");
        public static final Property IsLocked = new Property(17, Boolean.TYPE, "isLocked", false, "IS_LOCKED");
        public static final Property IsRandomRepeat = new Property(20, Boolean.TYPE, "isRandomRepeat", false, "IS_RANDOM_REPEAT");
        public static final Property IsShareAuto = new Property(15, Boolean.TYPE, "isShareAuto", false, "IS_SHARE_AUTO");
        public static final Property Other = new Property(14, String.class, "other", false, "OTHER");
        public static final Property Password = new Property(18, String.class, "password", false, Intents.WifiConnect.PASSWORD);
        public static final Property PhoneHeight = new Property(10, Integer.TYPE, "phoneHeight", false, "PHONE_HEIGHT");
        public static final Property PhoneWidth = new Property(9, Integer.TYPE, "phoneWidth", false, "PHONE_WIDTH");
        public static final Property RandomMax = new Property(22, Integer.TYPE, "randomMax", false, "RANDOM_MAX");
        public static final Property RandomMin = new Property(21, Integer.TYPE, "randomMin", false, "RANDOM_MIN");
        public static final Property RepeatNum = new Property(4, Integer.TYPE, "repeatNum", false, "REPEAT_NUM");
        public static final Property ShareUserID = new Property(16, String.class, "shareUserID", false, "SHARE_USER_ID");
        public static final Property ShowNotic = new Property(23, Boolean.TYPE, "showNotic", false, "SHOW_NOTIC");
        public static final Property SortNum = new Property(19, Integer.TYPE, "sortNum", false, "SORT_NUM");
        public static final Property Uuid = new Property(11, String.class, "uuid", false, "UUID");
    }

    /* access modifiers changed from: protected */
    @Override // org.greenrobot.greendao.AbstractDao
    public final boolean isEntityUpdateable() {
        return true;
    }

    public AutoBeanDao(DaoConfig daoConfig) {
        super(daoConfig);
    }

    public AutoBeanDao(DaoConfig daoConfig, DaoSession daoSession) {
        super(daoConfig, daoSession);
    }

    public static void createTable(Database database, boolean z) {
        String str = z ? "IF NOT EXISTS " : "";
        database.execSQL("CREATE TABLE " + str + "\"AUTO_BEAN\" (\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ,\"AUTO_ID\" TEXT UNIQUE ,\"AUTO_TYPE\" TEXT,\"AUTO_NAME\" TEXT,\"REPEAT_NUM\" INTEGER NOT NULL ,\"AUTO_TYPE_DETAIL\" TEXT,\"IS_ENABLE\" INTEGER NOT NULL ,\"CREATE_TIME\" TEXT,\"GROUP_ID\" TEXT,\"PHONE_WIDTH\" INTEGER NOT NULL ,\"PHONE_HEIGHT\" INTEGER NOT NULL ,\"UUID\" TEXT,\"ICON\" TEXT,\"COLOR\" TEXT,\"OTHER\" TEXT,\"IS_SHARE_AUTO\" INTEGER NOT NULL ,\"SHARE_USER_ID\" TEXT,\"IS_LOCKED\" INTEGER NOT NULL ,\"PASSWORD\" TEXT,\"SORT_NUM\" INTEGER NOT NULL ,\"IS_RANDOM_REPEAT\" INTEGER NOT NULL ,\"RANDOM_MIN\" INTEGER NOT NULL ,\"RANDOM_MAX\" INTEGER NOT NULL ,\"SHOW_NOTIC\" INTEGER NOT NULL );");
    }

    public static void dropTable(Database database, boolean z) {
        StringBuilder sb = new StringBuilder();
        sb.append("DROP TABLE ");
        sb.append(z ? "IF EXISTS " : "");
        sb.append("\"AUTO_BEAN\"");
        database.execSQL(sb.toString());
    }

    /* access modifiers changed from: protected */
    public final void bindValues(DatabaseStatement databaseStatement, AutoBean autoBean) {
        databaseStatement.clearBindings();
        Long id = autoBean.getId();
        if (id != null) {
            databaseStatement.bindLong(1, id.longValue());
        }
        String autoID = autoBean.getAutoID();
        if (autoID != null) {
            databaseStatement.bindString(2, autoID);
        }
        String autoType = autoBean.getAutoType();
        if (autoType != null) {
            databaseStatement.bindString(3, autoType);
        }
        String autoName = autoBean.getAutoName();
        if (autoName != null) {
            databaseStatement.bindString(4, autoName);
        }
        databaseStatement.bindLong(5, (long) autoBean.getRepeatNum());
        String autoTypeDetail = autoBean.getAutoTypeDetail();
        if (autoTypeDetail != null) {
            databaseStatement.bindString(6, autoTypeDetail);
        }
        long j = 1;
        databaseStatement.bindLong(7, autoBean.getIsEnable() ? 1 : 0);
        String createTime = autoBean.getCreateTime();
        if (createTime != null) {
            databaseStatement.bindString(8, createTime);
        }
        String groupID = autoBean.getGroupID();
        if (groupID != null) {
            databaseStatement.bindString(9, groupID);
        }
        databaseStatement.bindLong(10, (long) autoBean.getPhoneWidth());
        databaseStatement.bindLong(11, (long) autoBean.getPhoneHeight());
        String uuid = autoBean.getUuid();
        if (uuid != null) {
            databaseStatement.bindString(12, uuid);
        }
        String icon = autoBean.getIcon();
        if (icon != null) {
            databaseStatement.bindString(13, icon);
        }
        String color = autoBean.getColor();
        if (color != null) {
            databaseStatement.bindString(14, color);
        }
        String other = autoBean.getOther();
        if (other != null) {
            databaseStatement.bindString(15, other);
        }
        databaseStatement.bindLong(16, autoBean.getIsShareAuto() ? 1 : 0);
        String shareUserID = autoBean.getShareUserID();
        if (shareUserID != null) {
            databaseStatement.bindString(17, shareUserID);
        }
        databaseStatement.bindLong(18, autoBean.getIsLocked() ? 1 : 0);
        String password = autoBean.getPassword();
        if (password != null) {
            databaseStatement.bindString(19, password);
        }
        databaseStatement.bindLong(20, (long) autoBean.getSortNum());
        databaseStatement.bindLong(21, autoBean.getIsRandomRepeat() ? 1 : 0);
        databaseStatement.bindLong(22, (long) autoBean.getRandomMin());
        databaseStatement.bindLong(23, (long) autoBean.getRandomMax());
        if (!autoBean.getShowNotic()) {
            j = 0;
        }
        databaseStatement.bindLong(24, j);
    }

    /* access modifiers changed from: protected */
    public final void bindValues(SQLiteStatement sQLiteStatement, AutoBean autoBean) {
        sQLiteStatement.clearBindings();
        Long id = autoBean.getId();
        if (id != null) {
            sQLiteStatement.bindLong(1, id.longValue());
        }
        String autoID = autoBean.getAutoID();
        if (autoID != null) {
            sQLiteStatement.bindString(2, autoID);
        }
        String autoType = autoBean.getAutoType();
        if (autoType != null) {
            sQLiteStatement.bindString(3, autoType);
        }
        String autoName = autoBean.getAutoName();
        if (autoName != null) {
            sQLiteStatement.bindString(4, autoName);
        }
        sQLiteStatement.bindLong(5, (long) autoBean.getRepeatNum());
        String autoTypeDetail = autoBean.getAutoTypeDetail();
        if (autoTypeDetail != null) {
            sQLiteStatement.bindString(6, autoTypeDetail);
        }
        long j = 1;
        sQLiteStatement.bindLong(7, autoBean.getIsEnable() ? 1 : 0);
        String createTime = autoBean.getCreateTime();
        if (createTime != null) {
            sQLiteStatement.bindString(8, createTime);
        }
        String groupID = autoBean.getGroupID();
        if (groupID != null) {
            sQLiteStatement.bindString(9, groupID);
        }
        sQLiteStatement.bindLong(10, (long) autoBean.getPhoneWidth());
        sQLiteStatement.bindLong(11, (long) autoBean.getPhoneHeight());
        String uuid = autoBean.getUuid();
        if (uuid != null) {
            sQLiteStatement.bindString(12, uuid);
        }
        String icon = autoBean.getIcon();
        if (icon != null) {
            sQLiteStatement.bindString(13, icon);
        }
        String color = autoBean.getColor();
        if (color != null) {
            sQLiteStatement.bindString(14, color);
        }
        String other = autoBean.getOther();
        if (other != null) {
            sQLiteStatement.bindString(15, other);
        }
        sQLiteStatement.bindLong(16, autoBean.getIsShareAuto() ? 1 : 0);
        String shareUserID = autoBean.getShareUserID();
        if (shareUserID != null) {
            sQLiteStatement.bindString(17, shareUserID);
        }
        sQLiteStatement.bindLong(18, autoBean.getIsLocked() ? 1 : 0);
        String password = autoBean.getPassword();
        if (password != null) {
            sQLiteStatement.bindString(19, password);
        }
        sQLiteStatement.bindLong(20, (long) autoBean.getSortNum());
        sQLiteStatement.bindLong(21, autoBean.getIsRandomRepeat() ? 1 : 0);
        sQLiteStatement.bindLong(22, (long) autoBean.getRandomMin());
        sQLiteStatement.bindLong(23, (long) autoBean.getRandomMax());
        if (!autoBean.getShowNotic()) {
            j = 0;
        }
        sQLiteStatement.bindLong(24, j);
    }

    @Override // org.greenrobot.greendao.AbstractDao
    public Long readKey(Cursor cursor, int i) {
        int i2 = i + 0;
        if (cursor.isNull(i2)) {
            return null;
        }
        return Long.valueOf(cursor.getLong(i2));
    }

    @Override // org.greenrobot.greendao.AbstractDao
    public AutoBean readEntity(Cursor cursor, int i) {
        int i2 = i + 0;
        Long valueOf = cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2));
        int i3 = i + 1;
        String string = cursor.isNull(i3) ? null : cursor.getString(i3);
        int i4 = i + 2;
        String string2 = cursor.isNull(i4) ? null : cursor.getString(i4);
        int i5 = i + 3;
        String string3 = cursor.isNull(i5) ? null : cursor.getString(i5);
        int i6 = cursor.getInt(i + 4);
        int i7 = i + 5;
        String string4 = cursor.isNull(i7) ? null : cursor.getString(i7);
        boolean z = cursor.getShort(i + 6) != 0;
        int i8 = i + 7;
        String string5 = cursor.isNull(i8) ? null : cursor.getString(i8);
        int i9 = i + 8;
        String string6 = cursor.isNull(i9) ? null : cursor.getString(i9);
        int i10 = cursor.getInt(i + 9);
        int i11 = cursor.getInt(i + 10);
        int i12 = i + 11;
        String string7 = cursor.isNull(i12) ? null : cursor.getString(i12);
        int i13 = i + 12;
        String string8 = cursor.isNull(i13) ? null : cursor.getString(i13);
        int i14 = i + 13;
        String string9 = cursor.isNull(i14) ? null : cursor.getString(i14);
        int i15 = i + 14;
        String string10 = cursor.isNull(i15) ? null : cursor.getString(i15);
        boolean z2 = cursor.getShort(i + 15) != 0;
        int i16 = i + 16;
        String string11 = cursor.isNull(i16) ? null : cursor.getString(i16);
        int i17 = i + 18;
        return new AutoBean(valueOf, string, string2, string3, i6, string4, z, string5, string6, i10, i11, string7, string8, string9, string10, z2, string11, cursor.getShort(i + 17) != 0, cursor.isNull(i17) ? null : cursor.getString(i17), cursor.getInt(i + 19), cursor.getShort(i + 20) != 0, cursor.getInt(i + 21), cursor.getInt(i + 22), cursor.getShort(i + 23) != 0);
    }

    public void readEntity(Cursor cursor, AutoBean autoBean, int i) {
        int i2 = i + 0;
        String str = null;
        autoBean.setId(cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2)));
        int i3 = i + 1;
        autoBean.setAutoID(cursor.isNull(i3) ? null : cursor.getString(i3));
        int i4 = i + 2;
        autoBean.setAutoType(cursor.isNull(i4) ? null : cursor.getString(i4));
        int i5 = i + 3;
        autoBean.setAutoName(cursor.isNull(i5) ? null : cursor.getString(i5));
        autoBean.setRepeatNum(cursor.getInt(i + 4));
        int i6 = i + 5;
        autoBean.setAutoTypeDetail(cursor.isNull(i6) ? null : cursor.getString(i6));
        boolean z = true;
        autoBean.setIsEnable(cursor.getShort(i + 6) != 0);
        int i7 = i + 7;
        autoBean.setCreateTime(cursor.isNull(i7) ? null : cursor.getString(i7));
        int i8 = i + 8;
        autoBean.setGroupID(cursor.isNull(i8) ? null : cursor.getString(i8));
        autoBean.setPhoneWidth(cursor.getInt(i + 9));
        autoBean.setPhoneHeight(cursor.getInt(i + 10));
        int i9 = i + 11;
        autoBean.setUuid(cursor.isNull(i9) ? null : cursor.getString(i9));
        int i10 = i + 12;
        autoBean.setIcon(cursor.isNull(i10) ? null : cursor.getString(i10));
        int i11 = i + 13;
        autoBean.setColor(cursor.isNull(i11) ? null : cursor.getString(i11));
        int i12 = i + 14;
        autoBean.setOther(cursor.isNull(i12) ? null : cursor.getString(i12));
        autoBean.setIsShareAuto(cursor.getShort(i + 15) != 0);
        int i13 = i + 16;
        autoBean.setShareUserID(cursor.isNull(i13) ? null : cursor.getString(i13));
        autoBean.setIsLocked(cursor.getShort(i + 17) != 0);
        int i14 = i + 18;
        if (!cursor.isNull(i14)) {
            str = cursor.getString(i14);
        }
        autoBean.setPassword(str);
        autoBean.setSortNum(cursor.getInt(i + 19));
        autoBean.setIsRandomRepeat(cursor.getShort(i + 20) != 0);
        autoBean.setRandomMin(cursor.getInt(i + 21));
        autoBean.setRandomMax(cursor.getInt(i + 22));
        if (cursor.getShort(i + 23) == 0) {
            z = false;
        }
        autoBean.setShowNotic(z);
    }

    /* access modifiers changed from: protected */
    public final Long updateKeyAfterInsert(AutoBean autoBean, long j) {
        autoBean.setId(Long.valueOf(j));
        return Long.valueOf(j);
    }

    public Long getKey(AutoBean autoBean) {
        if (autoBean != null) {
            return autoBean.getId();
        }
        return null;
    }

    public boolean hasKey(AutoBean autoBean) {
        return autoBean.getId() != null;
    }
}
